| Conditions | 1 |
| Paths | 1 |
| Total Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import Proto from 'uberproto' |
||
| 13 | export default function localSocketer(url) { |
||
| 14 | return function () { |
||
| 15 | const app = this |
||
| 16 | |||
| 17 | app.configure(socket('io')) |
||
| 18 | |||
| 19 | Proto.mixin({ |
||
| 20 | setup() { |
||
| 21 | const io = this.io = new Server(url) |
||
| 22 | |||
| 23 | io.on('connection', socket => { |
||
| 24 | socket.feathers = { |
||
| 25 | provider: 'socketio' |
||
| 26 | } |
||
| 27 | }) |
||
| 28 | |||
| 29 | this._socketInfo = { |
||
| 30 | method: 'emit', |
||
| 31 | connection() { |
||
| 32 | return io |
||
| 33 | }, |
||
| 34 | clients() { |
||
| 35 | return io.clients() |
||
| 36 | }, |
||
| 37 | params(socket) { |
||
| 38 | return socket.feathers |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | return this._super.apply(this, arguments) |
||
| 43 | } |
||
| 44 | }, app) |
||
| 45 | } |
||
| 46 | } |
||
| 47 |